package com.kaiupup.study.servicePassengerUser.controller;

import com.kaiupup.study.dto.ResponseResult;
import com.kaiupup.study.request.VerificationCodeDTO;
import com.kaiupup.study.servicePassengerUser.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: kaiupup-online-taxi
 * @package: com.kaiupup.study.servicepassengeruser.controller
 * @className: UserController
 * @author: kaiupup
 * @description: TODO
 * @date: 2024/3/4 19:06
 * @version: 1.0
 */
@RestController
@Slf4j
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("user")
    public ResponseResult loginRrRegister(@RequestBody VerificationCodeDTO verificationCodeDTO){
        String passengerPhone = verificationCodeDTO.getPassengerPhone();
        log.info("UserController-loginRrRegister-手机号:{}",passengerPhone);
        return userService.loginOrRegisterUser(passengerPhone);
    }



}
